/**
 * Copyright (C) 2011 PROCESSBASE Ltd.
 * This library is free software; you can redistribute it and/or modify it under the terms
 * of the GNU Lesser General Public License as published by the Free Software Foundation
 * version 2.1 of the License.
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public License along with this
 * program; if not, see <http://www.gnu.org/licenses/>.
 */
package org.processbase.ui.core.template;

import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window.CloseEvent;

/**
 *
 * @author mgubaidullin
 */
public class WorkPanel extends VerticalLayout {

    protected HorizontalLayout horizontalLayout = new HorizontalLayout();
    private boolean initialized = false;
    
    public WorkPanel() {
        super();
        horizontalLayout.setSizeFull();
        setSizeFull();
        addComponent(horizontalLayout);
        setExpandRatio(horizontalLayout, 1);
        setMargin(false, false, false, false);
    }

    public void initUI(){
        initialized = true;
    }

    public void windowClose(CloseEvent e) {
    }

    public void showError(String errorMessage) {
        ((PbWindow) getWindow()).showError(errorMessage);
    }

    public void showInformation(String infoMessage) {
        ((PbWindow) getWindow()).showInformation(infoMessage);
    }

    public void showImportantInformation(String infoMessage) {
        ((PbWindow) getWindow()).showImportantInformation(infoMessage);
    }

    public void showWarning(String warningMessage) {
        ((PbWindow) getWindow()).showWarning(warningMessage);
    }

    public PbWindow getPbWindow(){
        return (PbWindow) this.getWindow();
    }

    public boolean isInitialized() {
        return initialized;
    }

    public void setInitialized(boolean initialized) {
        this.initialized = initialized;
    }

    
    
}
